package com.aisoback.controller;

import com.aisoback.common.BaseResponse;
import com.aisoback.common.ResultUtils;
import com.aisoback.manager.SearchUtils;
import com.aisoback.model.Request.SearchRequest;
import com.aisoback.model.vo.SearchVo;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;

@RestController
@RequestMapping("/search")
//@CrossOrigin(origins = "*")
public class SearchController {

    @Resource
    private SearchUtils searchUtils;

    @PostMapping("/all")
    public BaseResponse<SearchVo> SearchAll(@RequestBody SearchRequest searchRequest) throws IOException {
        SearchVo searchVo = searchUtils.SearchAll(searchRequest);
        return ResultUtils.success(searchVo);
    }
}
